package io.renren.modules.seal.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import cn.hutool.core.util.StrUtil;
import io.renren.common.service.impl.CrudServiceImpl;
import io.renren.commons.dynamic.datasource.annotation.DataSource;
import io.renren.modules.seal.dao.EcifSealFileDao;
import io.renren.modules.seal.dto.EcifSealFileDTO;
import io.renren.modules.seal.entity.EcifSealFileEntity;
import io.renren.modules.seal.service.EcifSealFileService;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * 印章图片表
 *
 * @author Mark sunlightcs@gmail.com
 * @since 1.0.0 2024-11-27
 */
@Service
@DataSource("cmas")
public class EcifSealFileServiceImpl extends CrudServiceImpl<EcifSealFileDao, EcifSealFileEntity, EcifSealFileDTO> implements EcifSealFileService {

    @Override
    public QueryWrapper<EcifSealFileEntity> getWrapper(Map<String, Object> params){
        String id = (String)params.get("id");

        QueryWrapper<EcifSealFileEntity> wrapper = new QueryWrapper<>();
        wrapper.eq(StrUtil.isNotBlank(id), "id", id);

        return wrapper;
    }


    @Override
    public EcifSealFileEntity findByCifseqAndCustType(String cifseq, String custType) {
        return baseDao.findByCifseqAndCustType(cifseq,custType);
    }
}